#ifndef RATIONNEL_H
#define RATIONNEL_H

#include "constante.h"
#include "entier.h"
#include "noncomplexnumber.h"
#include "dataexception.h"

class Fraction : public NonComplexNumber{
    int den,num;
public:
    Fraction(int,int)throw(DataException);
    Fraction(const Integer& = Integer(0),const Integer& = Integer(1))throw(DataException);

    Constante* operator+(const Constante&)const;
    Constante* operator*(const Constante&)const;
    Constante* operator/(const Constante&)const;
    Constante* operator-(const Constante&)const;
    Constante* operator-()const;

    std::string print()const {
        std::stringstream ss;
        ss <<num<<" / "<< den;
        return ss.str();
    }

    int getDen()const {return den;}
    int getNum()const {return num;}
};

#endif // RATIONNEL_H
